interface FlyInterface {
  fly(): void;
}
interface SwimInterface {
  swim(): void;
}

//鸭子这个类 可以实现飞的接口，实现游泳的接口
class Duck implements FlyInterface, SwimInterface {
  fly(): void {
    console.log("鸭子飞");
  }
  swim(): void {
    console.log("鸭子游");
  }
}
//创建Duck实例
const duck = new Duck();
duck.fly(); //鸭子飞
duck.swim(); //鸭子游
